<template>
	<view v-if="!userInfo.isWxPubUser && visible && region.name" class="content">
		<u-icon @click="visible = false" name="close-circle-fill" color="#fff"></u-icon>
		<text class="text text-ellipsis">关注“第三空间{{region.name}}站”，即使获取最新订单动态～</text>
		<view @click="copy" class="btn-copy">点击复制</view>
	</view>
</template>

<script>
	import {
		mapState
	} from "vuex"
	export default {
		name:"official-accounts-tip",
		data() {
			return {
				visible: true
			};
		},
		props: {
			region: {
				type: Object,
				default: () => {
					return { }
				}
			}
		},
		watch: {
			name(newValue, oldValue) {
				this.loadData()
			}
		},
		computed: {
			...mapState(["userInfo"])
		},
		created() {
		},
		methods: {
			async copy() {
				this.$copy(this.region.wxPubConfig.account)
			}
		}
	}
</script>

<style scoped>
	.content {
		background-color: rgba(0, 0, 0, 0.6);
		height: 68rpx;
		line-height: 68rpx;
		color: #FFFFFF;
		display: flex;
		align-items: center;
		font-size: 24rpx;
		padding: 0 30rpx;
		position: fixed;
		bottom: 50px;
		/* #ifndef H5 */
		bottom: 0;
		/* #endif */
		z-index: 999;
		width: 100%;
	}
	.text {
		margin-left: 6rpx;
		flex: 1;
	}
	.btn-copy {
		width: 125rpx;
		height: 40rpx;
		line-height: 40rpx;
		background: #D61719;
		border-radius: 20rpx;
		text-align: center;
		font-size: 24rpx;
	}
</style>
